#ifndef __PLAYER_MODE_H__
#define __PLAYER_MODE_H__

#include "render/objs/stageobj.h"
#include "render/pixel/pixelbitmap.h"
#include "./helper/readyhelper.h"
#include "../statmgr.h"

typedef void (Delegater::*OnPageBackClickFunc)();

//result page
#define PLAYER_RESULT_PAGE "player_result_bkg.jpg"
#define PLAYER_RESULT_POS Point(6, 20)

#define PLAYER_AI_DIR "./playermode/"

class PlayerModePage
{
public:
	PlayerModePage(string resultBkg = PLAYER_RESULT_PAGE, Point resultPos = PLAYER_RESULT_POS, string strAIDir = PLAYER_AI_DIR);
	virtual ~PlayerModePage();

protected:
	virtual void OnReadyEnd();
	virtual void OnStatEnd(int playerCount, StatData* pStatDatas);

private:
	void InitPlayers(string strLuaDir);
	void OnBtnMenuClick();

public:
	Event<OnPageBackClickFunc> OnMenuClick;

protected:
	size_t m_playerCount;

	ReadyHelper* m_pReadyHelper;
	StageObj* m_pStageObj;

	//result page
	PixelBitmap* m_pResultPage;
	vector<TextObj*> m_textlist;
};

#endif